package com.gree.yipai.base.config;

import android.content.Context;

import com.gree.yipai.base.module.ConfigModule;
import com.gree.yipai.server.BaseAction;

import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;

/**
 * 自定义全局配置
 *
 * @author youdelu
 */
public class AppConfigModule extends FrameConfigModule {
    @Override
    public void applyOptions(Context context, ConfigModule.Builder builder) {
        //通过第一种方式初始化BaseUrl
        builder.baseUrl(BaseAction.DOMAIN_FLYDIY);//TODO 配置Retrofit中的baseUrl
        builder.retrofitOptions(builder13 -> {
            //TODO 配置Retrofit
            //RxJava
            builder13.addCallAdapterFactory(RxJava2CallAdapterFactory.create());
        })
                .okHttpClientOptions(builder12 -> {
                    //TODO 配置OkHttpClient
                })
                .gsonOptions(builder1 -> {
                    //TODO 配置Gson
                });
    }
}
